<nz-page-header nzTitle="用户列表">
    <nz-breadcrumb nz-page-header-breadcrumb [nzAutoGenerate]="true">
        <nz-breadcrumb-item>
            <a [routerLink]="['/']">首页</a>
        </nz-breadcrumb-item>
    </nz-breadcrumb>
</nz-page-header>

<nz-card [nzExtra]="extraAction">
    <ng-template #extraAction>
        <!-- <button nz-button nzSize="large" (click)="create()" nzType="primary">{{'create' | translate}}</button>
        <nz-divider nzType="vertical"></nz-divider> -->
        <button nz-button nzSize="large" (click)="refresh()">{{'refresh' | translate}}</button>
    </ng-template>
    <nz-table #dataTable nzShowSizeChanger [nzFrontPagination]="false" [nzData]="dataItems$ | async" [nzTotal]="pageingInfo.totalItems"
        [(nzPageIndex)]="pageingInfo.pageNumber" [(nzPageSize)]="pageingInfo.pageSize" [nzLoading]="pageingInfo.isTableLoading" (nzPageIndexChange)="refresh()"
        (nzPageSizeChange)="refresh()">
        <thead>
            <tr>
                <th nzWidth="20em">Id</th>
                <th>userName</th>
                <th>name</th>
                <th>email</th>
                <th>phoneNumber</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <tr *ngFor="let data of dataTable.data">
                <td>{{ data.id }}</td>
                <td>{{ data.userName }}</td>
                <td>{{ data.name }}</td>
                <td>{{ data.email }}</td>
                <td>{{ data.phoneNumber }}</td>
                <td>
                    <a (click)="edit(data.id)">{{'edit' | translate}}</a>
                    <nz-divider nzType="vertical"></nz-divider>
                    <a nz-popconfirm [nzPopconfirmTitle]="'delete.warning'" (nzOnConfirm)="delete(data)"
                        nzPopconfirmPlacement="top">{{'delete' | translate}}</a>
                </td>
            </tr>
        </tbody>
    </nz-table>
</nz-card>